<?php
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
namespace Test1;

class Intersection1{}
class Intersection2{}

namespace Test2;
class TestClass
{
    public function classMethod(
            \Test1\Intersection1&TestClass $object,
            TestClass&\Test1\Intersection1 $param,
    ): \Test1\Intersection2&\Test1\Intersection1 {
        
    }

    public static function classStaticMethod(
            \Test1\Intersection1&TestClass $object, // static
            TestClass&\Test1\Intersection1 $param, // static
    ): \Test1\Intersection2&TestClass {
        
    }
}

class TestChildClass extends TestClass
{
    public function childClassMethod(TestClass&\Test1\Intersection1 $object, TestClass&\Test1\Intersection1 $object2): TestClass&\Test1\Intersection1 {
        
    }
}

interface TestInterface
{
    public function interfaceMethod(\Test1\Intersection1&TestClass $object, TestClass&\Test1\Intersection1 $param, ): TestClass&\Test1\Intersection1;
}

abstract class TestAbstractClass
{
    abstract protected function abstractClassMethod(TestClass&\Test1\Intersection1 $param, TestInerface&TestClass $object,): TestClass&\Test1\Intersection1;
}

trait TestTrait
{
    private function traitMethod(TestInterface&\Test1\Intersection2 $object, TestClass&\Test1\Intersection1 $param): TestInterface&TestClass {
        
    }
}
